package io.github.wppli.infrastructure.persistent.dao;

import io.github.wppli.infrastructure.persistent.po.Posts;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户发布的图文内容 Mapper 接口
 * </p>
 *
 * @author lijiaqiang@ljq1024.cc
 * @since 2025-03-10
 */
@Mapper
public interface IPostsDao extends BaseMapper<Posts> {

    List<Posts> queryPostsList(@Param("authorId") Long authorId);

    Posts queryPostsById(@Param("postId")Long postId);

    int deletePosts(@Param("postId")Long postId, @Param("authorId")Long authorId);

    void likePosts(@Param("postId")Long postId, @Param("adjustCount")int adjustCount);

    void updateCollectPostsCount(Long postId, Long userId, int adjustCount);

    List<Posts> findAll();
}
